/*
 * Game.java
 *
 * Created on 25 mai 2007, 11:45
 */

package devintgame;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 *
 * @author  gaby
 */
public class Game extends javax.swing.JFrame {
    JFrame me;
    JPanel scorePanel;
    Controler controler;
    /** Creates new form Game */
    public Game() {
        me = this;
        
        this.setLayout(new BorderLayout());
        
        controler = new Controler(this);
        (new Thread(controler)).start();
        //this.validate();
        
        this.getContentPane().remove(controler.getGamePanel());
        this.getContentPane().add (controler.getGamePanel(), BorderLayout.WEST);
        
        this.addKeyListener(new KeyListener () {
                    public void keyTyped(KeyEvent e) {}
                    public void keyPressed(KeyEvent e) {
                            if (e.getKeyCode() == 27) {//touche échap
                                   System.exit(0);
                            }
                    }
                    public void keyReleased(KeyEvent e) {}
            });
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        /** le panel des scores */
        scorePanel = new JPanel();
        scorePanel.setSize(1000, 1000);
        this.add(scorePanel, BorderLayout.EAST);
        
        this.pack();
    }
    
    public void paint (Graphics g){
       }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        new Game();
        //Controler pan = new Controler(game);
        //game.add(pan);
        //game.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //game.setVisible(true);
        
        
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
    
}
